﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ctdReader; 

namespace JsRunTool
{
    public partial class FrmCardReaderConfig : Form
    {
        public CardDllInterface cdf;
        public FrmCardReaderConfig()
        {
            InitializeComponent();
            cdf = CPublic.getCardDllInterface();
            initReader(ref cdf);

        }

        private void initReader(ref CardDllInterface cdf)
        {
            try
            {  
                combReader.Items.Clear();
                string[] list = cdf.initReadCard();
                foreach (object o in list)
                {
                    string s = (string)o;
                    combReader.Items.Add(s);
                }
                combReader.Text = list[0];
                cdf.setReader(combReader.Text);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void coBReader_SelectedIndexChanged(object sender, EventArgs e)
        {
            string txt = combReader.Text;
            cdf.setReader(combReader.Text);
        }
    }
}
